﻿@{
    Layout = null;
}
@model ZBZH_Manage_Order.Controllers.HomeController.CDList
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>网上订餐系统后台管理中心-首页</title>
    <link rel="stylesheet" type="text/css" href="~/Content/jquery-easyui-1.4.2/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="~/Content/jquery-easyui-1.4.2/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="~/Content/jquery-easyui-1.4.2/demo.css">
    <script type="text/javascript" src="~/Content/jquery-easyui-1.4.2/jquery.min.js"></script>
    <script type="text/javascript" src="~/Content/jquery-easyui-1.4.2/jquery.easyui.min.js"></script>
    <style>
        .easyui-datalist li {
            height: 20px;
        }
    </style>
    <script type="text/javascript">
        function bb() {
            //alert('22');
            $.ajax({
                type: 'GET',
                dataType: "json",
                url: '/Home/GetList',
                success: function (data) {
                    $.each(data, function (a, b, c) {

                        //alert(a);
                        //alert(b);
                        //alert(c);
                        $('#nav').accordion(
                            'add',
                            {
                                menuid: data.id,
                                title: data.name,
                                selected: false,
                                content: '<div style="padding:10px"><ul name="1231"><li>123123</li></ul></div>',
                            });
                    });
                }
            });

        }
        function a() {
            //$('#nav').accordion(
            //            'add',
            //            {
            //                menuid:1,
            //                title:222,
            //                selected: false,
            //                content: '<div style="padding:10px"><ul name="1231"><li>123123</li></ul></div>',
            //            });
            $.each({ name: "John", lang: "JS", lang2: "JS22" }, function (i, n) {
                //alert("Name: " + i + ", Value: " + n);
            });
        }
        window.onload = function () {
            $.post("/Home/getUser", {}, function (data) {

            });
            //alert('11');

        };

        //页面显示度
        var w;
        var h;
        function addcss()
        {
            var wie = document.body.clientWidth;
            var hei = document.body.clientHeight;
            w = wie - 193;
            h = hei - 70;
            
        }
        window.onload = addcss;
        //function addcss1()
        //{
           
        //    if (window.screen) {//判断浏览器是否支持window.screen判断浏览器是否支持screen 
        //        var myw = screen.availWidth-30; //定义一个myw，接受到当前全屏的宽 
        //        var myh = screen.availHeight-40; //定义一个myw，接受到当前全屏的高 
        //        window.moveTo(0, 0); //把window放在左上脚 
        //        window.resizeTo(myw, myh); //把当前窗体的长宽跳转为myw和myh 
        //    }
        //    //alert(myw + "--" + myh);
        //    addcss();
            

        //}
        window.onresize = addcss;

      

        //添加面板
        function addTab(title, url) {
            if ($('#tt').tabs('exists', title)) {
                $('#tt').tabs('select', title);
            } else {
                
                //var content = '<iframe scrolling="auto" frameborder="0"  src="' + url + '" style="width:100%;height:100%; "></iframe>';
                var content = '<iframe id="hr" scrolling="auto" frameborder="0"  src="' + url + '" style="width:' + w + 'px;height:' + h + 'px;" ></iframe>';
                
                $('#tt').tabs('add', {
                    title: title,
                    content: content,
                    closable: true,
                });
            }
        }
        function back() {
            $.post("/Home/BackLogin", {}, function (data) {
                if (data == "1") {
                    window.location.href = "/Login/LoginPage";
                } else {
                    $.messager.alert("友情提示", data);
                }
            });
        }
    </script>
</head>
<body id="body" class="easyui-layout">
    <!--北面start-->
    <div data-options="region:'north',border:false" style="height: 45px; background: #E6EEF8; padding: 10px">
        <div style="float:left;"><span style="font-size:20px;font-weight:700;color:#95B8E7;">广西大学-网上订餐后台管理系统</span></div>
        <a href="javascript:(back())" style="float: right">退出系统</a>
    </div>
    <!--北面end-->
    <!--西面start-->
    <div data-options="region:'west',split:true@*,title:'West'*@" style="width: 200px;">
        <div id="nav" class="easyui-accordion" style="border: 0px solid red;">
            @if (ViewBag.ll != null)
            {
                foreach (var item in ViewBag.ll)
                {
                    string cd = "";
                    foreach (var zcitem in item.zcdlist)
                    {
                        cd += " <li><a href=\"javascript:addTab('" + zcitem.name + "','" + zcitem.id + "');\"  style=\"text-decoration:none\">" + zcitem.name + "</a></li>";
                    }
                @Html.Raw("<div title=\"" + item.name + "\" style=\"overflow: auto; border: 0px solid red;\"> <ul class=\"easyui-datalist\" lines=\"true\" style=\"overflow: auto;\"> " + cd + "</ul></div>");
                }
            }else{
                <script type="text/javascript">
                    $.messager.alert("提示", "该操作员没有登录权限，请先获得管理权限");
                </script>
            }
        </div>
    </div>
    <!--西面end-->
    <!--东面start-->
    <!--东面end-->
    <!--南面start-->
    <div data-options="region:'south',border:false" style="height: 25px; background: #E6EEF8; text-align: center;">
        南宁筑波智慧科技有限公司
        <button id="bt" onclick="bb()"></button>
        <button id="bt2" onclick="a()"></button>
    </div>
    <!--南面end-->
    <!--内容页start-->
    <div id="tt" data-options="region:'center',plain: false,narrow: true,pill: false,justified: false" class="easyui-tabs" style="overflow:scroll;">
        <div title="主页"  style="padding: 10px; height: auto;" data-options="href:'/Home/HomeContent'"></div>
    </div>
    <!--内容页end-->
</body>
</html>
